package com.cn.lycss.servlet;

import com.alibaba.fastjson.JSONObject;
import com.cn.lycss.model.ImgModel;
import com.cn.lycss.model.ResultModel;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/upload")
public class UploadServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ResultModel resultModel=new ResultModel();
        ImgModel imgModel=new ImgModel();
        imgModel.setSrc("/img/10_hf6d.jpg");
        resultModel.setData(imgModel);
        resp.getWriter().print(JSONObject.toJSONString(resultModel));
    }
}
